package com.thiswhyme.api.vc.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.thiswhyme.common.response.ResponseVo;
import com.thiswhyme.vc.core.ApiVersion;

/**
 * @author: thiswhyme
 * @date: 2021/1/18
 */
@RestController
@RequestMapping("/test/")
public class TestController {

    @GetMapping("test")
    public ResponseVo<String> testV0(@RequestParam String name) {
        return ResponseVo.success("Default：" + name);
    }

    @ApiVersion("1.0.1")
    @GetMapping("test")
    public ResponseVo<String> testV1(@RequestParam String name) {
        return ResponseVo.success("V1.0.1：" + name);
    }

    @ApiVersion("1.0.2")
    @GetMapping("test")
    public ResponseVo<String> testV2(@RequestParam String name, @RequestParam String name2) {
        return ResponseVo.success("V1.0.2：" + name + name2);
    }
}
